<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" id="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<link rel="stylesheet" href="./css/reset.css" type="text/css" />
<link href="./css/my-indent.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/layer/layer.js"></script>
<title></title>
</head>
<body>
	<div class="zjzz-buylist-wear">

		<div class="zjzz-buylist-top">
			<a href="personal-center.jsp" class="zjzz-buylist-t1"></a> <span
				class="zjzz-buylist-t2">我的订单</span> <span class="zjzz-buylist-t3">
				<span class="zjzz-buylist-t4"></span>
			</span>
		</div>
		<div class="zjzz-buylist-top2">
			<a href="./my-indent-all.jsp" class="zjzz-buylist-tp1"> <i
				class="zjzz-buylist-tp2">全部</i>
			</a> <a href="./my-indent-dfk.jsp" class="zjzz-buylist-tp1"> <i>待付款</i>
				<span class=""></span>
			</a> <a href="./my-indent-dsh.jsp" class="zjzz-buylist-tp1"> <i>待收货</i>
				<span class=""></span>
			</a> <a href="./my-indent-pj.jsp" class="zjzz-buylist-tp1"> <i>评论</i>
				<span class=""></span>
			</a>
		</div>
		<div class="zjzz-buylist-mid">
			<!--全部-->
			<div class="zjzz-buylist-m1">
				<div class="wsh"></div>
				<div class="ysh"></div>
			</div>

		</div>
	</div>
</body>
<script type="text/javascript">
		$(function(){
			wsh();
			jycg();
		})
	</script>
<script type="text/javascript">
		function wsh(){
			$.post("../../../tszs/txr/routin_status.do",function(data){
				var html="";
				 for (var i = 0; i < data.data.length; i++) {
				html+="<div class=\"zjzz-buylist-goods1\"><div class=\"zjzz-buylist-gtime\">"+
				"<span class=\"zjzz-buylist-gtime1\">"+data.data[i].createtime+"</span>"+
				"<span class=\"zjzz-buylist-gtime2\">已发货</span>"+
			"</div>"+
			"<div class=\"zjzz-buylist-det\">"+
				"<img src='/file/"+data.data[i].phtoto+"' />"+
				"<div class=\"zjzz-buylist-gdetail\">"+
					"<span class=\"zjzz-buylist-gtit1\">"+data.data[i].c_name+"<br>"+data.data[i].c_describe+"</span>"+
					"<span class=\"zjzz-buylist-gmoney\">"+
						"<i class=\"zjzz-buylist-gm1\">￥"+data.data[i].href.split("--")[0]+"</i>"+
						"<i class=\"zjzz-buylist-gm2\">x"+data.data[i].product_num	+"</i>"+
					"</span>"+
				"</div>"+
			"</div>"+
			"<span class=\"zjzz-buylist-goodsm\">"+
				"<i class=\"zjzz-buylist-gm3\">共"+data.data[i].product_num	+"件</i>"+
				"<i>应付总额：<i class=\"zjzz-buylist-gm4\">￥"+data.data[i].href.split("--")[0]+"</i></i>"+
			"</span>"+
			"<div class=\"zjzz-buylist-btn\">"+
				"<a class=\"zjzz-buylist-btn2\" href=\"javascript:ConfirmReceipt('"+data.data[i].p_id+"')\")'>确认收货</a>"+
			"</div>"+
			"</div>";
				 }
			$(".wsh").append(html);
			 },"json")
		}
		function jycg(){
			 $.post("../../../tszs/txr/ysh.do",function(data){
				 var htmlsub="";
				 for (var i = 0; i < data.data.length; i++) {
					 htmlsub+="<div class=\"zjzz-buylist-goods1\">"+
				"<div class=\"zjzz-buylist-gtime\">"+
					"<span class=\"zjzz-buylist-gtime1\">"+data.data[i].createtime+"</span>"+
					"<span class=\"zjzz-buylist-gtime2\">交易成功</span>"+
				"</div>"+
				"<div class=\"zjzz-buylist-det\">"+
				"<img src='/file/"+data.data[i].phtoto+"' />"+
					"<div class=\"zjzz-buylist-gdetail\">"+
						"<span class=\"zjzz-buylist-gtit1\">"+data.data[i].c_name+"<br>"+data.data[i].c_describe+"</span>"+
						"<span class=\"zjzz-buylist-gmoney\">"+
						"</span>"+
					"</div>"+
				"</div>"+
				"<div class=\"zjzz-buylist-btn\" style='margin-top: 5px;'>"+
					"<a class=\"zjzz-buylist-btn3\" href=\"javascript:deleteOrder('"+data.data[i].p_id+"')\">"+data.data[i].href.split("--")[0]+"</a>"+
				"</div>"+
			"</div>";
			 }
				$(".ysh").append(htmlsub);
				 },"json")
		}
		function ConfirmReceipt(id){
			layer.confirm("确认收货？", {icon: 3, title: "提示信息"}, function(){
				//确认收货
				$.post("../txr/confirmOrder.do",{pId:id},function(res){
					layer.msg('确认收货成功！');
					setTimeout(function(){
						location.reload();
					}, 800)
				},"json")
			});
		}
		function deleteOrder(id){
			layer.confirm("确认删除订单记录？", {icon: 3, title: '提示信息'}, function(){
				$.post("../txr/updatePstatic.do?pId="+id,function(data){
					layer.msg("删除订单记录成功！");
					setTimeout(function(){
						location.reload();
					}, 800)
				},"json")
			});
		}
	</script>
</html>